<template>
    <div class="header-content fn-clear">
        <div class="logo fn-left">
            <img src="static/img/icon.png" alt="" width="100%">
        </div>
        <div class="adminName fn-left">长征月度投后报表</div>
        <div class="userLog fn-right">
            <i class="fa-user-circle-o fa-2x fn-left" v-if="!model.avatar"></i>
            <img :src="model.avatar" class="logo" v-else/>
        </div>
        <div class="modelName">
            <span>{{model.name}}</span>
        </div>
    </div>
</template>
<script>
export default {
    name: "Header",
    data: function() {
        return {
            model: {}
        }
    },
    created: function() {
        let user = sessionStorage.getItem('loginUser');
        // console.log(JSON.parse(user), 'JSON.parse(user)')
        if (user)
            this.model = JSON.parse(user);
    }
}
</script>

<style scoped>
.adminName {
  font-size: 18px;
  color: #fff;
  line-height: 40px;
}

.logo {
  margin-right: 10px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  border: 2px #fff solid;
  border-radius: 25px;
  overflow: hidden;
  background-color: #fff;
}

.userLog {
  line-height: 40px;
  margin-right: 50px;
  color: #fff;
}

.userLog span {
  margin-left: 10px;
}

.modelName {
  float: right;
  line-height: 40px;
  margin-right: -90px;
  height: 40px;
  color: #fff;
}
</style>